package com.exchange.Public;

import android.content.Context;
import android.content.Intent;
import com.exchange.Controller.a;
import com.exchange.b.a;
import java.util.ArrayList;

public class DownloadAgent
{
  private Context a;

  public DownloadAgent(Context paramContext, a parama, int paramInt1, int paramInt2)
  {
    this.a = paramContext;
    Intent localIntent = new Intent(this.a.getApplicationContext(), DownloadingService.class);
    localIntent.putExtra("adName", parama.g);
    localIntent.putExtra("adUrl", parama.h);
    ArrayList localArrayList = new ArrayList();
    localArrayList.add(parama);
    String str1 = a.a(this.a, 1, paramInt2, getPageLevel(this.a, paramInt1), paramInt1, localArrayList, 0).toString();
    localIntent.putExtra("reportLog", str1);
    String str2 = ExchangeConstants.LOG_TAG;
    Object[] arrayOfObject = new Object[3];
    arrayOfObject[0] = parama.g;
    arrayOfObject[1] = parama.h;
    arrayOfObject[2] = str1;
    n.c(str2, String.format("Kick off Service Start'ing: adName = %1$15s\t|\tadUrl = %2$15s\t|\treportLog = %3$15s", arrayOfObject));
    paramContext.startService(localIntent);
  }

  public int getPageLevel(Context paramContext, int paramInt)
  {
    int i = 2;
    switch (paramInt)
    {
    case 0:
    case 1:
    case 2:
    case 3:
    case 6:
    case 9:
    default:
    case 8:
    case 7:
    case 4:
    case 5:
    }
    while (true)
    {
      while (true)
      {
        while (true)
        {
          return i;
          i = 0;
        }
        i = 5;
      }
      i = 3;
    }
  }
}